package com.example.userservice.service;

import com.example.userservice.dto.UserDTO;
import com.github.pagehelper.PageInfo;
import java.util.List;

public interface UserService {
    UserDTO register(UserDTO userDTO);

    String login(String username, String password);

    UserDTO getUserInfo(Long userId, String roleCode, Long currentUserId);

    PageInfo<UserDTO> getUserList(int pageNum, int pageSize, String roleCode, Long currentUserId);

    UserDTO updateUser(Long userId, UserDTO userDTO, String roleCode, Long currentUserId);

    void resetPassword(Long userId, String newPassword, String roleCode, Long currentUserId);

    /**
     * 分布式事务：用户注册
     */
    void registerUserWithTransaction(UserDTO userDTO);

    /**
     * 本地事务：用户更新
     */
    void updateUserWithLocalTransaction(UserDTO userDTO);
}
